package com.constructor;


public class Student {
//    String name;
//    double score;
//
//    //无参数构造器
//    public Student() {
//        System.out.println("无参数构造器");
//    }
//
//    //有参数构造器
//    public Student (String name,double score) {
//        System.out.println("有参数构造器");
//        this.name = name;
//        this.score = score;
//    }

    private  double score;

    public void setScore(double score) {
        if(score>=0&&score<=100) {
            this.score = score;
        } else {
            System.out.println("错误");
        }

    }

    public double getScore() {
        return score;
    }

    public void printPass(){
        System.out.println(score>=60?"及格": "不及格");
    }
}
